$(function(){
    $("#update-btn").click(function (){
        edit();
    })




});
function edit(){

    let empId = id;
    let kind_id = $(":input[name=kind_id]").val();
    if(kind_id.trim() === ""){
        layer.msg("顾客编号不能为空");
        return false;
    }

    let name = $(":input[name=name]").val();
    if(name.trim() === ""){
        layer.msg("顾客姓名编号不能为空");
        return false;
    }
    let description = $(":input[name=description]").val();
    let url = ctx + "/kind/edit";
    console.log(empId);
    $.post(url,{
        empId,
       kind_id,
        name,
        description
    },function (resp){
        if(resp.success){
            layer.alert("修改成功",function (){
                location.href = ctx+"/kind/list";
            });
        }else{
            layer.alert(resp.error||"删除失败，请稍后再试");
        }

    },"json");
}
